#include <iostream>
using namespace std;
int main() {
    int n;
    cin>>n;
    while(n--){
        int a,b;
        cin>>a>>b;
        if(a<b)cout<<"NO BRAINS"<<endl;
        else cout<<"MMM BRAINS"<<endl;
    }
    return 0;
}
